/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.ufes.gpf.sgm.presenter;

import edu.ufes.gpf.sgm.view.MenuView;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 *
 * @author Danilo
 */
public class MenuPresenter
{
    MenuView view = new MenuView();

    public MenuPresenter()
    {
        
        view.getMnuSair().addActionListener(new ActionListener()
        {

            @Override
            public void actionPerformed(ActionEvent e)
            {
                view.dispose();
            }
        });
        
        view.getMnuCadMandados().addActionListener(new ActionListener()
        {

            @Override
            public void actionPerformed(ActionEvent e)
            {
                new IncluirMandadoPresenter(null);
            }
        });
        
        view.getMnuCadPessoas().addActionListener(new ActionListener()
        {

            @Override
            public void actionPerformed(ActionEvent e)
            {
                new IncluirPessoaPresenter(null);
            }
        });
        
        view.getMnuListMandados().addActionListener(new ActionListener()
        {

            @Override
            public void actionPerformed(ActionEvent e)
            {
                new ListarMandadosPresenter();
            }
        });
        
        view.getMnuListPessoas().addActionListener(new ActionListener()
        {

            @Override
            public void actionPerformed(ActionEvent e)
            {
                new ListarPessoasPresenter();
            }
        });
        
        view.setVisible(true);
        view.setLocationRelativeTo(null);
        view.setTitle("Menu Inicial");
    }
    
}
